package com.stoneframe.controller.manageSystem;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.stoneframe.controller.base.BaseGenericController;
import com.stoneframe.service.BaseService;
import com.stoneframe.service.manageSystem.SysRoleService;
import com.stoneframe.util.baseApp.AppHelper;
import com.stoneframe.util.baseApp.PageData;
import com.stoneframe.util.baseJson.TreeJsonHelper;

@Controller
@RequestMapping(value="sysRole")
public class SysRoleController extends BaseGenericController {
	
	@Resource(name="sysRoleService")
	private SysRoleService sysRoleService;

	@Override
	public BaseService getService() {
		// TODO Auto-generated method stub
		return sysRoleService;
	}
	
	@ResponseBody
	@RequestMapping(value="comboBox")
	public Object comboBox(){
		logBefore(logger, className+"comboBox");
		
		PageData pd=this.getPageData();
		List<PageData> list=null;
		try{
			list=sysRoleService.listAll(pd);
			logAfter(logger);
			return AppHelper.returnObject(pd,list);
		}catch(Exception e){
			logger.error(e.toString(),e);
			return AppHelper.errorObject(e.getMessage());
		}
		
	}

}
